address generate_call_stub(address& return_address) {
StubCodeMark mark(this, "StubRoutines", "call_stub");
address start = __ pc();
assert(frame::entry_frame_call_wrapper_offset == 2, "adjust this code");
bool sse_save = false;
const Address rsp_after_call(rbp, -4 * wordSize);
const int locals_count_in_bytes (4*wordSize);
const Address mxcsr_save (rbp, -4 * wordSize);
const Address saved_rbx (rbp, -3 * wordSize);
const Address saved_rsi (rbp, -2 * wordSize);
const Address saved_rdi (rbp, -1 * wordSize);
const Address result (rbp, 3 * wordSize);
const Address result_type (rbp, 4 * wordSize);
const Address method (rbp, 5 * wordSize);
const Address entry_point (rbp, 6 * wordSize);
const Address parameters (rbp, 7 * wordSize);
const Address parameter_size(rbp, 8 * wordSize);
const Address thread (rbp, 9 * wordSize);
sse_save = UseSSE > 0;
---------------------------------------------
| void MacroAssembler::enter() { |
| push(rbp); |
| mov(rbp, rsp); |
| } |
---------------------------------------------
__ enter();
__ movptr(rcx, parameter_size);
__ shlptr(rcx, Interpreter::logStackElementSize);
__ addptr(rcx, locals_count_in_bytes);
__ subptr(rsp, rcx);
__ andptr(rsp, -(StackAlignmentInBytes));
__ movtr(saved_rdi, rdi);
__ movptr(saved_rsi, rsi);
__ movptr(saved_rbx, rbx);
......
......
Label parameters_done;
__ movl(rcx, parameter_size);
__ testl(rcx, rcx);
__ jcc(Assembler::zero, parameters_done);
Label loop
__ movptr(rdx, parameters);
__ xorptr(rbx, rbx);
__ BIND(loop);
__ movptr(rax, Address(rdx, rcx, Interpreter::stackElementScale(), -wordSize));
__ movptr(Address(rsp, rbx, Interpreter::stackElementScale(),
Interpreter::expr_offset_in_bytes(0)), rax);
__ increment(rbx);
__ decrement(rcx);
__ jcc(Assembler::notZero, loop);
__ BIND(parameters_done);
__ movptr(rbx, method);
__ movptr(rax, entry_point);
__ mov(rsi, rsp);
__ call(rax);
......
}